package com.ruoyi.classification.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.classification.mapper.CommodityProductClassMapper;
import com.ruoyi.classification.domain.CommodityProductClass;
import com.ruoyi.classification.service.ICommodityProductClassService;

/**
 * 商品分类Service业务层处理
 * 
 * @author kzc
 * @date 2024-03-09
 */
@Service
public class CommodityProductClassServiceImpl implements ICommodityProductClassService 
{
    @Autowired
    private CommodityProductClassMapper commodityProductClassMapper;

    /**
     * 查询商品分类
     * 
     * @param categoryId 商品分类主键
     * @return 商品分类
     */
    @Override
    public CommodityProductClass selectCommodityProductClassByCategoryId(Integer categoryId)
    {
        return commodityProductClassMapper.selectCommodityProductClassByCategoryId(categoryId);
    }

    /**
     * 查询商品分类列表
     * 
     * @param commodityProductClass 商品分类
     * @return 商品分类
     */
    @Override
    public List<CommodityProductClass> selectCommodityProductClassList(CommodityProductClass commodityProductClass)
    {
        return commodityProductClassMapper.selectCommodityProductClassList(commodityProductClass);
    }

    /**
     * 新增商品分类
     * 
     * @param commodityProductClass 商品分类
     * @return 结果
     */
    @Override
    public int insertCommodityProductClass(CommodityProductClass commodityProductClass)
    {
        return commodityProductClassMapper.insertCommodityProductClass(commodityProductClass);
    }

    /**
     * 修改商品分类
     * 
     * @param commodityProductClass 商品分类
     * @return 结果
     */
    @Override
    public int updateCommodityProductClass(CommodityProductClass commodityProductClass)
    {
        return commodityProductClassMapper.updateCommodityProductClass(commodityProductClass);
    }

    /**
     * 批量删除商品分类
     * 
     * @param categoryIds 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteCommodityProductClassByCategoryIds(Integer[] categoryIds)
    {
        return commodityProductClassMapper.deleteCommodityProductClassByCategoryIds(categoryIds);
    }

    /**
     * 删除商品分类信息
     * 
     * @param categoryId 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteCommodityProductClassByCategoryId(Integer categoryId)
    {
        return commodityProductClassMapper.deleteCommodityProductClassByCategoryId(categoryId);
    }
}
